import requests
import time
import os


def main():
    sums = 0
    ts = str(int(time.time())) + '000'
    nodejs = os.popen('node 03 ' + ts)
    m = nodejs.read().replace('\n', '') + '|' + ts
    nodejs.close()
    headers = {
        'cookie': 'm=' + m,
    }
    for page in range(1, 6):
        url = 'http://match.yuanrenxue.com/api/match/2?page=' + str(page)
        response = requests.get(url, headers=headers).json()
        for each in response['data']:
            sums += each['value']
    print(sums)
    # 总和：248974


if __name__ == '__main__':
    main()